//
//  TMWechatSocietyManger.h
//  GoldChampion
//
//  Created by Mac on 2018/5/8.
//  Copyright © 2018年 BeautyFood@icloud.com. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <WXApi.h>
#import <WechatOpenSDK/WechatAuthSDK.h>
typedef void(^TMWeChatSocietyLoginHandle)(BOOL success,NSString * alert);
typedef void(^TMWeChatSocietyUserInfoHandle)(NSDictionary* infoDic,NSString * errorDesc);

typedef void(^TMWeChatSocietyShareHandle)(BOOL success,NSString * alert);

typedef void(^TMWeChartMangerPayHandle)(BOOL success,NSString * alert);//支付回调
/************微信登录分享manger******************/
@interface TMWechatSocietyManger : NSObject<WXApiDelegate>
@property(nonatomic, strong,readonly) NSString                     *appId;/**< 微信appid */
@property(nonatomic, strong) NSString                     *appSecert;/**< 微信密码，如果需要查询用户信息 */
@property(nonatomic, strong) NSString                     *token;/**< 登录成功的token 用户查询用户信息 */
@property(nonatomic, strong) NSString                     *openid;/**< 查询信息之后的openID */
+ (TMWechatSocietyManger*)manger;

#pragma mark --AppDelegate You Should do
- (BOOL)registerWechatWithAppId:(NSString*)appId;
//登录
- (void)beginLoginWithLoginHandle:(TMWeChatSocietyLoginHandle)handle;
//需要在登录之后 且appId appSecert token 都存在
- (void)fetchUserInfoWithHandle:(TMWeChatSocietyUserInfoHandle)handle;
//分享
- (void)shareToWeChatText:(NSString*)text toFriendCirle:(BOOL)toFriendCirle handle:(TMWeChatSocietyShareHandle)handle;
//支付
- (void)startPayOrderDic:(NSDictionary*)orderDic payHandle:(TMWeChartMangerPayHandle)payHandle;
@end
